package com.bite.book.dao;

import com.bite.book.model.BookInfo;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Component
public class BookDao {
    public List<BookInfo> list = new ArrayList<>();
    public List<BookInfo> mockBookList(){

        for (int i = 1; i <= 15; i++) {
            BookInfo book = new BookInfo();
            //book.setId(String.valueOf(i));
            book.setBookName("图书"+i);
            book.setAuthor("作者"+i);
            book.setPublish("出版社"+i);
            book.setCount(new Random().nextInt(100));
            book.setPrice(new Random().nextFloat(100));
            book.setStatus(i%3==1?1:0);
            list.add(book);
        }
        return list;
    }
}
